from abc import ABC, abstractmethod
from unittest import TestCase
from fromework.utils.webdriver_factory import WebDriverFactory
from fromework.utils.log import LogFactory


class TestBase(ABC, TestCase):
    case_id: str = None
    case_name: str = None
    feature: str = None
    logger = LogFactory.get_log()

    @classmethod
    def set_case_info(cls, case_id: str, case_name: str, feature: str) -> None:
        cls.case_id = case_id
        cls.case_name = case_name
        cls.feature = feature
        cls.logger.info(f'case_id:{case_id}  case_name:{case_name}  feature:{feature}')

    @classmethod
    def tearDownClass(cls) -> None:
        WebDriverFactory.stop()
